import instance from "@/util/axios.js"
/**
 * 获取学生信息
 * @param {*} page 页码
 * @param {*} limit 每页多少条
 * @param {*} keyword 条件对象 dormitoryId: "宿舍楼Id",floorId : "楼层Id",roomNoId: "宿舍Id",loginId: "学号",
nickname: "学生姓名"
 * @returns 学生数组
 */
export const getStudentInfo = async ({page=1,limit=10,keyword}) => 
await instance.get("/api/admin/students",{
    params: {
        page,
        limit,
        keyword
    }
})

/**
 * 获取起床记录
 * @param {string} startingTime 起始时间
 * @param {string} endTime 终止时间
 * @param {number} studentId 学生id
 */
export const getup = async ({page,limit,startingTime,endTime,studentId}) =>
await instance.get("/api/admin/getup",{
    params:{page,limit,startingTime,endTime,studentId}
})

/**
 * 获取归宿记录
 * @param {string} startingTime 起始时间
 * @param {string} endTime 终止时间
 * @param {number} studentId 学生id
 */
export const destination = async ({page,limit,startingTime,endTime,studentId})=>
await instance.get("/api/admin/destination",{
    params:{page,limit,startingTime,endTime,studentId}
})
/**
 * 获取打扫记录
 * @param {string} startingTime 起始时间
 * @param {string} endTime 终止时间
 * @param {number} studentId 学生id
 */
export const clean = async ({page,limit,startingTime,endTime,studentId}) =>
await instance.get("/api/admin/clean",{
    params:{page,limit,startingTime,endTime,studentId}
})


/**
 * 获取学生入住记录
 */
export const getCheckInRecord = async ({page=1,limit=10,keyword}) =>
await instance.get("/api/super/getCheckInRecord",{
    params: {
        page,
        limit,
        keyword
    }
})